import VueRouter from "vue-router";
import router from "@/router";
import { v4 as uuidv4 } from 'uuid';
export const getUserTempId = function (){
    if(!localStorage.getItem("userTempId")) localStorage.setItem("userTempId",uuidv4());
    return localStorage.getItem("userTempId");
}
export const enhanceRouter = function (fnName) {
    const copyFn = VueRouter.prototype[fnName];
    VueRouter.prototype[fnName] = function (to,onComplete = () => {}, onAbort = () => {}) {
        copyFn.call(this, to, onComplete, onAbort);
    }
};
export const pushSearch = function (obj){
    router.push({
        path:'/search',
        query:{
            ...router.currentRoute.query,
            ...obj
        }
    })
}